﻿using Microsoft.Extensions.Options;
using MySqlConnector;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CanalService.EFCore
{
    public class ProjectEFCoreContext : EFCoreDBContext
    {
        public ProjectEFCoreContext(IOptions<EFCoreDBContextOptions> optionsAccessor) : base(optionsAccessor)
        {

        }

        /// <summary>
        /// 指定连接的数据库类型
        /// </summary>
        /// <param name="connectionString"></param>
        /// <returns></returns>
        protected override IDbConnection CreateConnection(string connectionString)
        {
            //MySQL连接
            IDbConnection conn = new MySqlConnection(connectionString);
            return conn;
        }
    }
}
